
import 'dart:convert';

List<StationModel> StationModelFromMap(String str) =>
    List<StationModel>.from(json.decode(str).map((x) => StationModel.fromMap(x)));


class Alias {
  final int id;
  final String name;

  Alias(this.id,this.name);

  factory Alias.fromMap(Map<String, dynamic> json) => Alias(
        json['id'],
        json['name']
        );
}

class StationModel {

  final int id;
  final String station_id;
  final String station_name;
  final String lng;
  final String lat;
  final List<Alias> alias;


  StationModel(
    this.id,
    this.station_id,
    this.station_name,
    this.lng,
    this.lat,
    this.alias,
  );

  factory StationModel.fromMap(Map<String, dynamic> json) => StationModel(
        json["id"],
        json["station_id"],
        json["station_name"],
        json["lng"],
        json["lat"],
        List<Alias>.from(json["alias"].map((x) => Alias.fromMap(x))),
      );

  // Map<String, dynamic> toMap() => {
  //       "id": id,
  //       "name": name,
  //       "product": List<dynamic>.from(product.map((x) => x.toMap())),
  //     };
}